package com.ita.tba.po;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ita.tba.dao.DishDao;
import com.ita.tba.dao.impl.DishDaoImpl;

public class DishCache {
	private static DishDao dishDao = new DishDaoImpl();
	public static Map<Integer, Dish> dishCache = new HashMap<Integer, Dish>();
	
	public static Map<Integer, Dish> getDishes() {
		List<Dish> dishList = new ArrayList<Dish>();
		dishList = dishDao.selectAllDishes();
		
		for (Dish dish : dishList) {
			dishCache.put(dish.getDishId(), dish);
		}
		return dishCache;
	}
}
